import request from '@/utils/request';

// 赛事列表
export const getCompetitionsList = (params) => {
  return request({
    url: '/competitions/registration/list',
    method: 'get',
    params: params,
  });
};

// 赛事信息
export const getCompetitionsInfo = (id, params) => {
  return request({
    url: `/competitions/registration/getInfo/${id}`,
    method: 'get',
    params: params,
  });
};

// 保存赛事
export const addCompetitions = (data) => {
  return request({
    url: '/competitions/registration/add',
    method: 'post',
    data,
  });
};

// 修改赛事
export const editCompetitions = (data) => {
  return request({
    url: '/competitions/registration/edit',
    method: 'put',
    data,
  });
};

// 赛事报名记录列表
export const getBookRecordList = (params) => {
  return request({
    url: '/competitions/record/list',
    method: 'get',
    params: params,
  });
};

// 保存赛事报名记录
export const addBookRecord = (data) => {
  return request({
    url: '/competitions/record/add',
    method: 'post',
    data,
  });
};
